var { shell } = require('electron')

var aHref = document.querySelector('#aHref')
var mybtn = document.querySelector('#mybtn')

aHref.onclick = function(e){
  e.preventDefault()
  var href = this.getAttribute('href')
  shell.openExternal(href)
}

mybtn.onclick = function(e){
  // window.open('https://jspang.com')
  window.open( 'file://' + __dirname + '/popup_page.html');
}

window.addEventListener('message',(msg)=>{
  let mytext = document.querySelector('#mytext')
  mytext.innerHTML = JSON.stringify(msg)
})
